#include<iostream>
#include<stack>
#include<utility>
#include<string>
#include<vector>
#include<map>
#include<functional>

using namespace std;

vector<string> S{ "12", "1", "+", "221", "362", "/", "-", "100", "+", "200", "+" };

int main()
{
	stack<int> K;
	map<string, function<int(int x, int y)>>Fun=
	{
		{"+", [](int x, int y) {return x + y; }},
		{ "-", [](int x, int y) {return y - x; }},
		{ "*", [](int x, int y) {return x * y; } },
		{ "/", [](int x, int y) {return y /x ; }}
	};
	for (auto& e : S)
	{
		if (Fun.count(e))
		{
			int r1 = K.top();
			K.pop();
			int r2 = K.top();
			K.pop();
			int ret = Fun[e](r1, r2);
			K.push(ret);
		}
		else
		{
			K.push(stoi(e));
		}
	}
	cout << K.top();
	return 0;
}